﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;


public partial class login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (FormsAuthentication.Authenticate(txtUsername.Text, txtPassword.Text))
        {
            lblStatus.Text = ("Welcome " + txtUsername.Text);
            FormsAuthentication.RedirectFromLoginPage(txtUsername.Text, true);
        }
        else
        {
            lblStatus.Text = "Invalid login!";
        }
    }
}